I have the following code:
*
string strSQLExists2 = "Select from MYTABLE where (EmpEmail > ' ' AND IssueDate = CONVERT(DATETIME, '" + DueDate +"', 102)) AND (JobID='" + values["JobNo"].ToString() + "')";
XVar rsExists2 = CommonFunctions.db_query(strSQLExists2, null);
XVar rsTemp2 = CommonFunctions.db_fetch_array(rsExists2);
email1 = rsTemp2["EmpEmail"].ToString();
msg = "YOU HAVE BEEN AWARDED " + rsTemp2["QTY"].ToString() ;
XVar ret = MVCFunctions.runner_mail(new XVar("to", "xyz@mydomain.com", "subject", "Award", "body", msg, "from", "admin@mydomain.com"));
if(!ret["mailed"]){
MVCFunctions.EchoToOutput(ret["message"]);
}
What I'd like to do is to email all the users found in the table with the SELECT statement. My table contains a field that has the email address. The code above is only sending to the first record found.
How do I code this so it send to all records found?
Thanks in advance.